<script setup lang="ts">
import type { FormDesignerComponents } from "../FormComponentMixin";
import CommonConfig from "./CommonConfig.vue";
const config = defineModel<FormDesignerComponents>("config");
const propsCollapse = ref("0");
</script>

<template>
  <el-collapse v-model="propsCollapse" accordion>
    <el-collapse-item name="0">
      <template #title>
        <div class="collapse-title">
          <el-icon color="#1890ff"><List /></el-icon>
          <div>基本属性</div>
        </div>
      </template>
      <CommonConfig v-model:config="config" />
      <el-form-item label="提示文字">
        <el-input
          v-model="config.props.placeholder"
          type="textarea"
          :row="3"
          placeholder="输入提示文字"
        />
      </el-form-item>
      <el-form-item label="提示位置">
        <el-radio-group v-model="config.props.placement">
          <el-radio label="top" value="top" />
          <el-radio label="top-start" value="top-start" />
          <el-radio label="top-end" value="top-end" />
          <el-radio label="bottom" value="bottom" />
          <el-radio label="bottom-start" value="bottom-start" />
          <el-radio label="bottom-end" value="bottom-end" />
          <el-radio label="left-start" value="left-start" />
          <el-radio label="left-end" value="left-end" />
          <el-radio label="right" value="right" />
          <el-radio label="right-start" value="right-start" />
          <el-radio label="right-end" value="right-end" />
        </el-radio-group>
      </el-form-item>
    </el-collapse-item>
  </el-collapse>
</template>

<style lang="scss" scoped>
.collapse-title {
  padding: 0px 5px;
  display: flex;
  align-items: center;

  & > div {
    margin-left: 10px;
  }
}
</style>
